fix: confirm extraction history item deletion#2261
Conversation
1a61c0b to
587f5dc
Compare
nettee
left a comment
There was a problem hiding this comment.
I found one blocking regression in the new confirmation flow and one non-blocking localization follow-up.
🔁 Powered by Looper · runner=reviewer · agent=opencode · model=openai/gpt-5.4 · An autonomous AI dev team for your GitHub repos.587f5dc to
6b22b15
Compare
| if (!pendingExtractionDeleteId) return; | ||
| setIsDeletingExtraction(true); | ||
| try { | ||
| await onDeleteExtraction(pendingExtractionDeleteId); |
There was a problem hiding this comment.
At apps/web/src/components/MemorySection.tsx:1361, the new confirm path still lets a rejected DELETE leave the row optimistically hidden. onDeleteExtraction() removes the row before awaiting deleteExtraction(id), and this await onDeleteExtraction(...) call only handles the ok === false case—if fetch() rejects (for example because the daemon is offline), the rejection escapes, the dialog stays open, and the item is only recoverable after a manual reload. The added tests in apps/web/tests/components/MemorySection.test.tsx cover a 500 response but never a rejected promise, so the PR body claim that failed deletion keeps or restores the item is still unmet for this failure mode. Please catch rejected deletes here (or inside onDeleteExtraction), restore or reload the extraction list on failure, and add a test where the mocked DELETE request rejects.
Fixes #2249
Why
Deleting an individual extraction history item in Settings → Memory → Extraction history happened immediately after clicking the row delete control.
That made it too easy for a user to accidentally remove their own extraction history data with no confirmation, warning, or undo path. This PR adds a confirmation step for the individual row delete flow so the delete action only runs after explicit confirmation.
What users will see
In Settings → Memory → Extraction history, clicking the delete control on a single history item now opens a confirmation dialog.
The item is not deleted unless the user confirms the action. Canceling or dismissing the dialog leaves the history item unchanged.
Surface area
apps/weborapps/desktop(including Electron menu bar)odsubcommand or flag, newtools-dev/tools-pack/tools-prflag, or newOD_*env var/api/*endpoint, new SSE event, or changed shape inpackages/contractsskills/,design-systems/,design-templates/, orcraft/, or change to the skills protocolpackage.jsonScreenshots
Not attached.
The visible change is a confirmation dialog shown after clicking the delete control for an individual extraction history item.
Bug fix verification
Test path that reproduces the bug:
apps/web/tests/components/MemorySection.test.tsxAdded/updated tests covering:
Did the test go red on
mainand green on this branch?main.Validation
Passed locally:
./node_modules/.bin/vitest run -c vitest.config.ts tests/components/MemorySection.test.tsx20 passed./node_modules/.bin/tsc -b --noEmitLint:
apps/webdoesnt define a lint script